﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum NodeType 
{
    NodePass = 0,
    NodeStop = 1,
    NodeStart = 2,
    NodeEnd = 3
}

public class AStarNode
{
    public AStarNode fatherNode; //格子的父对象
    public int posX; //格子的x坐标
    public int posY; //格子的y坐标
    public NodeType nodeType;
    public float f; //寻路消耗
    public float g; //离起点的距离
    public float h; //离终点的距离(曼哈顿街区算法)

    private AStarManager manager; //格子管理器

    public AStarNode(int x, int y, NodeType type) 
    {
        posX = x;
        posY = y;
        nodeType = type;
        manager = AStarManager.Instance;
    }
}
